package model

const TableNameUserTenantRel = "user_tenant_rel"

type UserTenantRel struct {
	UserID   string `gorm:"column:user_id;primaryKey;type:varchar(255);not null" json:"user_id"`     // 用户ID
	TenantID string `gorm:"column:tenant_id;primaryKey;type:varchar(255);not null" json:"tenant_id"` // 租户ID

	// 关联
	User   User   `gorm:"foreignKey:UserID;references:ID"`
	Tenant Tenant `gorm:"foreignKey:TenantID;references:ID"`
}

func (*UserTenantRel) TableName() string {
	return TableNameUserTenantRel
}
